package com.yjt.sousou.detail;

import android.os.Bundle;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.yjt.sousou.R;
import com.yjt.sousou.base.BaseActivity;
import com.yjt.sousou.detail.entity.OrderDetail;

import java.util.ArrayList;

import butterknife.BindView;

/**
 * 作者：83734
 * 时间：2018/11/25
 * 描述：工单日志
 */
public class OrderLogActivity extends BaseActivity {
    @BindView(R.id.tv_title)
    TextView mTvTitle;
    @BindView(R.id.rv_log)
    RecyclerView mRvLog;
    private ArrayList<OrderDetail.DataBean.LogBean> mLogs = new ArrayList<>();
    @Override
    protected Object setContentLayout() {
        return R.layout.activity_order_log;
    }

    @Override
    protected void init(@Nullable Bundle savedInstanceState) {
        mTvTitle.setText(R.string.order_detail_log);
        ArrayList<OrderDetail.DataBean.LogBean> logs = getIntent().getParcelableArrayListExtra("logs");
        if(logs!=null && logs.size()>0)
        mLogs.addAll(logs);
        initRecycleView();
    }

    private void initRecycleView() {
        LinearLayoutManager manager = new LinearLayoutManager(this);
        mRvLog.setLayoutManager(manager);
        OrderLogAdapter adapter = new OrderLogAdapter(R.layout.item_order_log, mLogs);
        mRvLog.setAdapter(adapter);
    }
}
